package com.fuyun.microservice.codec;

import io.netty.handler.codec.MessageToMessageCodec;


public enum PacketType {
    CONNECTREQUEST((short) 0x0001, LoginRequestMessageCodec.class),
    CONNECTRSPONSE((short) 0x6001, LoginResponseMessageCodec.class),
    HEARTBEARTREQUEST((short) 0x0002, QueryRequestMessageCodec.class),
    QUERYREQUEST((short) 0x0003, QueryRequestMessageCodec.class),
    QUERYRESPONSE((short) 0x6003, QueryResponseMessageCodec.class),
    BROADREQUEST((short) 0x6004, BroadRequestMessageCodes.class),
    BROADRESPONSE((short) 0x0004, HeaderCodec.class);

    private short commandId;
    private Class<? extends MessageToMessageCodec> codec;

    PacketType(short commandId, Class<? extends MessageToMessageCodec> codec) {
        this.commandId = commandId;
        this.codec = codec;
    }

    public short getCommandId() {
        return commandId;
    }

    public Class<? extends MessageToMessageCodec> getCodec() {
        return codec;
    }


}
